package com.hikvision.open.app.ui

import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.hikvision.open.app.ui.broadcast.BroadcastActivity
import com.hikvision.open.app.ui.download.DownloadActivity
import com.hikvision.open.app.ui.permission.PermissionDemoActivity
import com.hikvision.open.app.ui.playback.PlaybackActivity
import com.hikvision.open.app.ui.preview.PreviewActivity
import com.hikvision.open.app.utils.inflate
import hik.sdk.demo.databinding.ActivityMainBinding

/**
 * <p> 主界面 </p>
 * @author 段自航 2021/7/13 16:46
 * @version V1.0
 */
class MainActivity : AppCompatActivity() {

    private val viewBinding: ActivityMainBinding by inflate()


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(viewBinding.root)
        
        //实时预览
        viewBinding.previewButton.setOnClickListener {
            startActivity(Intent(this, PreviewActivity::class.java))
        }
        //录像回放
        viewBinding.playbackButton.setOnClickListener {
            startActivity(Intent(this, PlaybackActivity::class.java))
        }
        //广播喊话
        viewBinding.broadcastButton.setOnClickListener {
            startActivity(Intent(this, BroadcastActivity::class.java))
        }
        //录像下载
        viewBinding.downloadButton.setOnClickListener {
            startActivity(Intent(this, DownloadActivity::class.java))
        }
        //权限演示
        viewBinding.permissionDemoButton.setOnClickListener {
            startActivity(Intent(this, PermissionDemoActivity::class.java))
        }
    }
}